<%@ page import="com.ecomm.util.Config,
                 java.util.Hashtable,
                 com.ecomm.util.Function,
                 com.ecomm.orgmodel.UserInfoExt"%>
<%@page contentType="text/html;charset=utf-8"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<%@include file="/include/currentuserinfo.jsp"%>
<%
    if(RtxDataModel.RTX_ENABLED)
    {
%>
<%@ include file="/rtx/rtxlogin.jsp" %>
<%
    }
    String sThemePath=ctxpath+Config.getString("theme.newstyle.path","")+"/";
    String sThemeImagePath=ctxpath+Config.getString("theme.newstyle.imagepath","")+"/";
    String sThemeCssPath=ctxpath+Config.getString("theme.newstyle.csspath","")+"/";

	String currentSkin=request.getParameter("style");
    currentSkin = (currentSkin==null)?(String)session.getAttribute("currentSkin"):currentSkin;
    if(currentSkin==null)
    {
            //从数据库中获取样式信息

            UserInfoExt userinfoext = new UserInfoExt();
            Hashtable cri = new Hashtable();
            cri.put("id",userid);
            userinfoext = (UserInfoExt)userinfoext.openByCriteria(cri);
            if( (userinfoext==null)||(userinfoext.getSkincss()==null)||("".equals(userinfoext.getSkincss())))
                currentSkin=Config.getString("theme.newstyle.defaultskin","office97");
            else
                currentSkin = userinfoext.getSkincss();
    }
	String currentSkinCss=sThemePath+"styles/"+currentSkin+"/"+currentSkin+"menu.css";

    //设置当前应用的样式表
    session.setAttribute("currentStylePath",sThemePath+"styles/"+currentSkin+"/");
    session.setAttribute("currentCss",currentSkinCss);
    session.setAttribute("currentSkin",currentSkin);

	String currentSkinImage=sThemeImagePath+currentSkin;
	
	String functionUrl = request.getParameter("functionUrl");
	
	//System.out.println("-------- in index.jsp ------ functionUrl = "+functionUrl);
	
	String fowardUrl = null;
	if (!"".equals(Function.normalizeString(functionUrl)))
	{
		fowardUrl = ctxpath+"/themes/newstyle/frame/welcome.jsp?functionUrl="+functionUrl;
	}
	else
	{
		fowardUrl = ctxpath+"/themes/newstyle/frame/welcome.jsp";
	}
%>

<html>
<head>
<title>Platform</title>

<style type="text/css">
<!--

body	{margin: 0px;border:0;}
#contentDiv	{width: 100%; height: 100%;}
#contentFrame	{width: 100%; height: 100%;}

-->
</style>

<link type="text/css" rel="stylesheet" href="<%=sThemePath+"media/"%>mt_style.css" >
<link type="text/css" rel="stylesheet" href="<%=currentSkinCss%>" id="menuStyleSheet">
<script type="text/javascript" src="<%=sThemePath+"javascript/"%>menu3.js"></script>
<script type="text/javascript" src="<%=sThemePath+"media/"%>mt_dropdownC.js"></script>
<script type="text/javascript" src="<%=sThemePath+"media/"%>mt_dropdown_initialize.js"></script>
<script type="text/javascript">
<!--

var customheight=0 ;
function fixSize() {
	try{

		contentDiv.style.height = document.body.offsetHeight - menuBar.offsetHeight - topblank.offsetHeight - bottomblank.offsetHeight - indextopFrame.offsetHeight;
	}catch(e)
	{
	}
}

window.onload = fixSize;
window.onresize = fixSize;


//-->
</script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body scroll="no" id="indexbody" onload="init();">

<!-- 页面顶部文件 -->
<div id="indextopFrame">
<iframe name="topFrame" src="<%=sThemePath%>skinInfo.jsp" id="topFrame" ></iframe>
</div>

<!--演示时所用的菜单-->
<tiles:insert page="/themes/newstyle/menu.jsp" ></tiles:insert>

<!--选择风格菜单的开始 -->
<%--<jsp:include page="/themes/newstyle/styles/stylemenu.html" />--%>
<%@include file="/themes/newstyle/styles/stylemenu.html"%>
<!-- D选择风格菜单的结束 -->


<!--选择风格菜单的开始 -->
<%
          boolean bAccreditLogin =
                  (null == session.getAttribute("originalLoginUserId") &&
                  null == session.getAttribute("originalLoginUserId"))?true:false;
          if(bAccreditLogin){
%>
<%--<jsp:include page="/oa/accredit/accreditmenu.html" />--%>
<%@include file="/oa/accredit/accreditmenu.html"%>
<%
          }else{
%>
<%--<jsp:include page="/oa/accredit/accreditloginmenu.html" />--%>
<%@include file="/oa/accredit/accreditloginmenu.html"%>
<%
          }
%>
<!-- D选择风格菜单的结束 -->

<!--  全部菜单结束 -->


<div id="contentDiv" style="border:0px;">

<script type="text/javascript">
fixSize();
</script>

<iframe name="contentFrame" src="<%=fowardUrl%>" id="contentFrame" style="border:0px"></iframe>
    
</div>
</body>
</html>
